package swing.chapter02;

import swing.util.SwingConsle;

import javax.swing.*;
import java.awt.*;

/**
 * FlowLayout 所有的组件将被压缩到它们的最小尺寸
 */
public class FlowLayout1 extends JFrame {
    public FlowLayout1() throws HeadlessException {
        setLayout(new FlowLayout());

        for(int i=0;i<20;i++){
            add(new JButton("Button " + i));
        }
    }

    public static void main(String[] args) {
        SwingConsle.run(new FlowLayout1(), 300, 300);
    }
}
